<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>涂装设计清单查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <input type="hidden" th:value="${proCode}" name="proCode">
                                <input type="hidden" th:value="${special}" name="special">
                                <input type="hidden" th:value="${part}" name="part">
                                <input type="hidden" th:value="${typeId}" name="typeId">
                                <div class="form-group">
                                    <label for="query-reportType">单据类型</label>
                                    <select id="query-reportType" class="form-control" name="sheetType">
                                        <option value="" selected>请选择</option>
                                        <option value="1">原始单</option>
                                        <option value="2">变更单</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="query-createName">提报人</label>
                                    <input id="query-createName" type="text" name="createName" class="form-control"
                                           placeholder="请输入提报人">
                                </div>
                                <div class="form-group">
                                    <label for="query-startTime">日期</label>
                                    <input id="query-startTime" type="text" class="form-control datepicker"
                                           name="startTime"
                                           readonly="readonly"/>
                                    <label for="query-endTime"> 至 </label>
                                    <input id="query-endTime" type="text" class="form-control datepicker" name="endTime"
                                           readonly="readonly"/>
                                </div>
                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;

    $(function () {

        /** 加载列表 */
        table = js.table.init({
            url: ctx + "summary/coat/queryList",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "项目编号", field: 'proCode'},
                {title: "项目名称", field: 'proName'},
                {title: "项目数量", field: 'proNum'},
                {title: "类型", field: 'special'},
                {title: "部分", field: 'proPart'},
                {
                    title: "单据类型", field: 'sheetType',
                    formatter: function (value) {
                        return value === 1 ? '原始单' : '变更单';
                    }
                },
                {title: "提报人", field: 'createName'},
                {title: "提报科室", field: 'branchName'},
                {title: "提报日期", field: 'createTime'},
                {title: "批准时间", field: 'aTime'},
                {
                    title: "操作",
                    formatter: function (value, row) {
                        let actions = [];
                        actions.push('<a class="btn btn-info btn-xs"  href="' + ctx + 'painting/coat/view/' + row.id + '"> 查看</a> ');
                        return actions.join('');
                    }
                }
            ]
        });




    });
</script>
</body>
</html>
